package cn.doit.scala.day05.high_function.kelihua

/**
 * @DATE 2021/12/30/16:54
 * @Author MDK
 * @Version 2021.2.2
 * */
object C06_柯里化 {
  def m(a:A)(b:a.B)={
    println(a)
  }
  //普通方法
  def  add(x:Int, y:Int)={
    x+y
  }
  //柯里化的方法
  def add2(x:Int)(y:Int): Int ={
    x+y
  }
  def  add3(x:Int)(y:Int,z:Int): Int ={
    x+y+z
  }
  def main(args: Array[String]): Unit = {
    println(add(3, 4))
    println(add2(3)(4))

    val f: Int => Int = add2(3)
    val i = f(4)
    println(i)
    val f1: (Int, Int) => Int = add3(3)
    println(f1(1,4))
  }
}
